<form>

  <script type="text/javascript" src="formretain.js">
  </script>

      <script type="text/javascript">
        function showhide1(sh){
        if(sh) {
        disp="inline";
        zi=1;
        }else{
        disp="none";
        zi=-10;
        }

        for (i=0; i<document.getElementsByTagName("*").length; i++) {
        if (document.getElementsByTagName("*").item(i).className == "divclass1")
        {
        document.getElementsByTagName("*").item(i).style.display=disp;
        document.getElementsByTagName("*").item(i).style.zIndex=zi;
        }
        }
        }
    </script>
    <script type="text/javascript">
      function showhide2(sh){

      if(sh) {
      disp="inline";
      zi=1;
      }else{
      disp="none";
      zi=-10;
      }

      for (i=0; i<document.getElementsByTagName("*").length; i++) {
      if (document.getElementsByTagName("*").item(i).className == "divclass2")
      {
      document.getElementsByTagName("*").item(i).style.display=disp;
      document.getElementsByTagName("*").item(i).style.zIndex=zi;
      }
      }
      
      }
      </script>
      </br>
      </br>
      Select Units:
          <input type="radio" name="type" value="Metric" checked="checked" onclick="showhide1(1); showhide2(0);"/>
            Metric
          <input type="radio" name="type" value="Standard" onclick="showhide1(0); showhide2(1);"/>
            US standards</br>
         </br>
            <div class="divclass1">
               <%= form_tag('home/') do %>
                  <ul>
                  <%= label_tag :year %>
                  <%= select_tag(:year,
                  options_for_select(Bmi::YEAR_LIST, "2010")) %>
                  </ul>
                  <ul>
                  <%= label_tag :gender %>
                  <%= select_tag(:gender,
                  options_for_select(Bmi::GENDER_LIST), :prompt => "Select...") %>
                  </ul>
                  <ul>
                  <%= label_tag :race %>
                  <%= select_tag(:race,
                  options_for_select(Bmi::RACE_LIST), :prompt => "Select...") %>
                  </ul>
                  <ul>
                  <%= label_tag :activity_level %>
                  <%= select_tag(:activity_level,
                  options_for_select(Bmi::ACTIVITY_LEVEL), :prompt => "Select...") %>
                  </ul>              
                  <ul>
                    <%= label_tag :age %>
                  <%= number_field_tag(:age, nil, :in => 18...65) %> (18 - 65)
                  </ul>
                  <ul>
                  <%= label_tag :weight %>
                  <%= number_field_tag(:weight_kg, nil, :in => 46...136) + "kg" %> (46 - 136)
                  </ul>
                  <ul>
                  <%= label_tag :height %>
                  <%= number_field_tag(:height_cm, nil, :in => 140...203) + "cm"%>
                  </ul>
                  <ul>
                    <%= submit_tag("Calculate") %>
                  </ul>
                  <% end %>
            </div>
            
            <div class="divclass2" style="display: none;">
              
                  <%= form_tag('home/') do %>
                  <ul>
                  <%= label_tag :year %>
                  <%= select_tag(:year,
                  options_for_select(Bmi::YEAR_LIST, "2010")) %>
                  </ul>
                  <ul>
                  <%= label_tag :gender %>
                  <%= select_tag(:gender,
                  options_for_select(Bmi::GENDER_LIST), :prompt => "Select...") %>
                  </ul>
                  <ul>
                  <%= label_tag :race %>
                  <%= select_tag(:race,
                  options_for_select(Bmi::RACE_LIST), :prompt => "Select...") %>
                  </ul>
                  <ul>
                  <%= label_tag :activity_level %>
                  <%= select_tag(:activity_level,
                  options_for_select(Bmi::ACTIVITY_LEVEL), :prompt => "Select...") %>
                  </ul>                   
                  <ul>
                  <%= label_tag :age %>
                  <%= number_field_tag(:age, nil, :in => 18...65) %> (18 - 65)
                  </ul>           
                  <ul>
                  <%= label_tag :weight %>
                  <%= number_field_tag(:weight_lb, nil, :in => 100...300)+ "lb"  %> (100 - 300)
                  </ul>
                  <ul>
                  <%= label_tag :height %>
                  <%= select_tag(:height_feet, options_for_select(Bmi::FEET_LIST)) + "feet" + select_tag(:height_inch, options_for_select(Bmi::INCH_LIST)) +  "inch"%>
                  </ul>
                  <ul>
                    <%= submit_tag("Calculate") %>
                  </ul>
                  <% end %>
            </div>
        
      </form>